<?php
function view_news_type_list($news_type_list)
{
	return view_type_list($news_type_list, "list.php");
}

function view_product_type_list($product_type_list)
{
	return view_type_list($product_type_list, "list.php");
}

function view_type_list($type_list, $type_list_url)
{
	$result = "";
	foreach ($type_list as $type)
	{
		$result = $result . view_type($type, $type_list_url);
	}
	return $result;
}

function view_type($type, $type_list_url)
{
	$result = sprintf(
	"<!--type start-->
	<div class='type'>
		<div class='type_name'><a href='./%s?type=%d'>%s</a></div>
	</div>
	<!--type end-->",
	$type_list_url,
	$type['id'],
	$type['name']
	);
	return $result;
}
?>
